package com.tangding.controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.tangding.common.exception.GException;
import com.tangding.controller.hprose.HproseHelper;
import com.tangding.pojo.request.forward.ForwardParams;
import com.tangding.pojo.response.MessageDto;

/**
 * @description 
 *
 * @author Ranger
 * @version 2017年11月13日_上午10:59:59
 *
 */
@RestController
public class ForwardController {
	/**
	 * 转发服务
	 * 
	 * @param operate 操作
	 * @return
	 * @throws GException
	 */
	@RequestMapping(value = {"/weforward/{operate}"})
	public MessageDto weforward(@PathVariable(required=true) String operate, ForwardParams params) throws GException {
		Object result = HproseHelper.invoke(operate, params.getParam());
//		Map<String, Object> result = new HashMap<>();
//		result.put("code", ErrorConstants.SUCC + 1);
		return MessageDto.responseSuccess(result);
	}
}
